package com.android.sharecar.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RatingBar;

public class EvaluationActivity extends Activity {

	// members
	private RatingBar mManner, mCar, mRideSafety, mRideSpeed;
	private EditText mComment;
	private Button mSubmitEvaluation, mNoEvaluation;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.evalutaion);

		findViews();

		setListenerForViews();
	}

	private void findViews() {
		mCar = (RatingBar) findViewById(R.id.evaluationactivity_rb_car);
		mRideSafety = (RatingBar) findViewById(R.id.evaluationactivity_rb_rideSafety);
		mRideSpeed = (RatingBar) findViewById(R.id.evaluationactivity_rb_rideSpeed);
		mManner = (RatingBar) findViewById(R.id.evaluationactivity_rb_manner);

		mComment = (EditText) findViewById(R.id.evaluationactivity_et_comment);
		mNoEvaluation = (Button) findViewById(R.id.evaluationactivity_btn_noEvaluation);
		mSubmitEvaluation = (Button) findViewById(R.id.evaluationactivity_btn_submitEvaluation);
	}

	private void setListenerForViews() {
		mNoEvaluation.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(EvaluationActivity.this,
						MainTabWidgetActivity.class);
				intent.putExtra("state", 0);
				startActivity(intent);
			}
		});

		mSubmitEvaluation.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(EvaluationActivity.this,
						MainTabWidgetActivity.class);
				intent.putExtra("state", 0);
				startActivity(intent);
			}
		});

	}
}
